Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(core): Add svelte docs recipe #18590

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

ndcunningham
Copy link
Contributor

@ndcunningham ndcunningham commented Aug 11, 2023

Add Svelte documentation for Nx recipes

Preview

@ndcunningham ndcunningham added type: docs scope: docs Issues related to generic docs labels Aug 11, 2023
@ndcunningham ndcunningham self-assigned this Aug 11, 2023
@ndcunningham ndcunningham requested review from a team as code owners August 11, 2023 16:37
@vercel
Copy link

vercel bot commented Aug 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2023 2:39pm

docs/map.json Outdated
{
"name": "Add a Svelte Project",
"id": "add-svelte",
"description": "Add a Vue project to your repo",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Add a Vue project to your repo",
"description": "Add a Svelte project to your repo",

});
```

{%callout type="Note"%}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{%callout type="Note"%}
{%callout type="Note" title="Why use the .mts file extension?" %}

Comment on lines 166 to 198
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/acme"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "acme:build"
},
"configurations": {
"development": {
"buildTarget": "acme:build:development",
"hmr": true
},
"production": {
"buildTarget": "acme:build:production",
"hmr": false
}
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/acme"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "acme:build"
},
"configurations": {
"development": {
"buildTarget": "acme:build:development",
"hmr": true
},
"production": {
"buildTarget": "acme:build:production",
"hmr": false
}
}
},
{
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/acme"
},
"configurations": {
"development": {
"mode": "development"
},
"production": {
"mode": "production"
}
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "acme:build"
},
"configurations": {
"development": {
"buildTarget": "acme:build:development",
"hmr": true
},
"production": {
"buildTarget": "acme:build:production",
"hmr": false
}
}
}
}
}


Navigate to `project.json` and update it with the following content:

```json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```json
```json {% fileName="/apps/svelteapp/project.json" %}

**Create a new Nx workspace**

```shell
create-nx-workspace@latest acme --preset=ts-standalone --nx-cloud=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't start with standalone. Start with integrated. The idea is that someone already has an Nx workspace and wants to add Svelte to it.

## Create the application

```shell
touch index.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
touch index.html
touch apps/svelteapp/index.html

docs/shared/recipes/add-stack/add-svelte.md Outdated Show resolved Hide resolved
export { default as Counter } from './Counter.svelte';
```

{% callout "Note" %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% callout "Note" %}
{% callout "Note" title="Remember the default keyword" %}

@meeroslav meeroslav merged commit 2180268 into nrwl:master Aug 17, 2023
3 checks passed
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: docs Issues related to generic docs type: docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants